import React, { PureComponent } from "react";
import { connect } from "dva";
import { Row, Col,} from "antd";
import CurrentMaintenance from "./CurrentMaintenance";
import MaintenancPlan from "./MaintenancPlan";
import Map from "./Map";
// import MaintenancTrack from "./MaintenancTrack";
import styles from "./component.less";


@connect()
export default class Dashboard extends PureComponent {
  constructor(props) {
    super(props);

  }

  componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
      type: 'monitor/fetch_mainten_map',
    });
  }

  componentWillUnmount(){
    const { dispatch } = this.props;
    dispatch({
      type: `monitor/appendClearState`,
    })
  }



  render() {

    // const screenHeight=document.documentElement.clientHeight-125 || document.body.clientHeight-125;

    const screenHeight="100%";

    return (
      <Row gutter={{ md: 8, lg: 24, xl: 48 }} style={{height:'100%',marginTop:-9}}>
        <Col md={16} style={{height:'100%',paddingRight:0,paddingLeft:15}}>
          <div className={styles.map_contain}>
            <Map />
            {/*<MaintenancTrack/>*/}
          </div>

        </Col>
        <Col md={8} style={{height:'100%',position:'relative',paddingRight:15,paddingLeft:15}}>
          <div className={styles.map_contain} style={{background:'none'}}>
            <CurrentMaintenance/>
            <MaintenancPlan/>
          </div>
        </Col>

      </Row>

    );
  }
}
